//package com.ruibang.glass.produce.component.job;
//
//import com.ruibang.glass.produce.constant.Constants;
//import com.ruibang.glass.produce.entity.DefectSizeAnalysis;
//import com.ruibang.glass.produce.mapper.DefectSizeAnalysisMapper;
//import com.teaming.cloud.framework2.elastic.job3.annotation.ElasticJobScheduler;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.shardingsphere.elasticjob.api.ShardingContext;
//import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.time.LocalDateTime;
//
///**
// * @Author: songJinKang
// * @CreateTime: 2024-04-27  17:32
// * @Description: TODO
// * @Version: 1.0
// */
//
//@Slf4j
////@ElasticJobScheduler(cron = "0 55 0 * * ? ")
//@ElasticJobScheduler(cron = "0 * * * * ?")
//@Component
//public class DefectSizeAnalysisTask implements SimpleJob {
//
//    @Autowired
//    private DefectSizeAnalysisMapper defectSizeAnalysisMapper;
//
//    @Override
//    public void execute(ShardingContext shardingContext) {
//        LocalDateTime currentTime = LocalDateTime.now();
//        LocalDateTime startTime = LocalDateTime.of(currentTime.getYear(), currentTime.getMonthValue(), currentTime.getDayOfMonth(), currentTime.getHour() - 1, 0, 0);
//        LocalDateTime endTime = LocalDateTime.of(currentTime.getYear(), currentTime.getMonthValue(), currentTime.getDayOfMonth(), currentTime.getHour(), 0, 0);
//
//        //获取数据
//        DefectSizeAnalysis defectSizeAnalysis = defectSizeAnalysisMapper.getLastHourData(startTime, endTime);
//        defectSizeAnalysis.setCollectTime(startTime);
//        defectSizeAnalysisMapper.insert(defectSizeAnalysis);
//    }
//
//}
